 /*
 * Team Name: Focus
 * Team Members: Diana Groun, Edward Bassan
 * File Name; memory.h
 * Description: This file contains the definition of memory and its members
 */

#include "global.h"
#ifndef MEMORY_H_
#define MEMORY_H_

#define MEMORY_SIZE 200
#define STACK_SIZE 50
#define MEMORY_OFFSET 0x3000
#define STACK_OFFSET 0xFFCE

// Defining a Memory structure
typedef struct Memory{
	//member fileds
	Byte  memory[MEMORY_SIZE];
	Byte stack[50];
	// member functions
	Byte(*fetchByte)(struct Memory*,int);
	Word(*fetchWord)(struct Memory*,int);
	int(*storeByte)(struct Memory*, int, unsigned char);
	int(*storeWord)(struct Memory*, int,unsigned short);
	int(*displayMemory)(struct Memory*);
	int(*displayStack)(struct Memory*);
	int(*dispalyMemoryLocation)(struct Memory*,int,int);
}Memory;

// Creating a pointer type
typedef Memory*MemoryPtr;

// Defining functions that will be used by function
MemoryPtr newMemory();
int displayStack(MemoryPtr);
Byte memoryFetchByte(MemoryPtr,int);
Word memoryFetchWord(MemoryPtr,int);
int memoryStoreByte(MemoryPtr, int, unsigned char);
int memoryStoreWord(MemoryPtr, int,unsigned short);
int displayMemory(MemoryPtr);
int dispalyMemoryLocation(MemoryPtr,int,int);
#endif /* MEMORY_H_ */
